package com.norra.base.api.entity

import com.google.gson.annotations.SerializedName
import java.io.Serializable

class DeviceResponse : BaseResponse() {

    @SerializedName("deviceList")
    var deviceList: List<Device>? = null

}

class Device : Serializable {
    @SerializedName("DevId")
    var devId: Long? = null

    @SerializedName("DevName")
    var devName: String? = null

    @SerializedName("Address")
    var address: String? = null

    @SerializedName("District")
    var district: String? = null

    @SerializedName("CreateOn")
    var createOn: String? = null

    @SerializedName("Lat")
    var lat: Double? = null

    @SerializedName("Lng")
    var lng: Double? = null

    @SerializedName("Model")
    var models: Array<String>? = null

    @SerializedName("Status")
    var status: Array<Int>? = null

    fun isNeedClean(): Boolean {
        return isNeedCleanHouseHold() || isNeedCleanGarden() || isNeedCleanOther() || isNeedCleanFood()
    }

    fun isNeedCleanHouseHold(): Boolean {
        return status != null && status!![0] == 1
    }

    fun isNeedCleanFood(): Boolean {
        return status != null && status!![1] == 1
    }

    fun isNeedCleanGarden(): Boolean {
        return status != null && status!![2] == 1
    }

    fun isNeedCleanOther(): Boolean {
        return status != null && status!![3] == 1
    }

}

open class TrashType : Serializable {
    companion object {
        const val HOUSE_HOLD = "HouseHold"
        const val FOOD = "Food"
        const val GARDEN = "Garden"
        const val OTHERS = "Others"
    }
}